package iconcurrent;

/**
 * @author or2
 * @Description 在join时线程状态? Blocked: Waiting;
 * @create 2021年09月11日 时间: 12:02
 */
public class StatusInJoin {
    public static void main(String[] args) throws InterruptedException {
        Thread mainThread = Thread.currentThread();

        Runnable task = () -> {
            for (int i = 0; i < 1000; i++) {
            }
            System.out.println(mainThread.getState());
        };
        Thread thread = new Thread(task);
        thread.start();
        thread.join();
    }
}
